package com.leo.boot.mongo.customer;

import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.util.Assert;

@Data
@Document
public class Customer {

	private String id, firstname, lastname;
	private Address address;

	public Customer(String firstname, String lastname) {
		Assert.hasText(firstname, "Firstname must not be null or empty!");
		Assert.hasText(lastname, "Lastname must not be null or empty!");

		this.firstname = firstname;
		this.lastname = lastname;
	}
}
